<?php
namespace app\admin\model;

use think\facade\Db;

class MyModels
{
    static public function getModel($id=1,$field='table'){
        $data = Db::name(getTable('models'))
            ->where('id',$id)
            ->find();
        if($field){
            if($data[$field]??null){
                return $data[$field];
            }
            return '';
        }
        return '';
    }
}